package com.sh.data.engine.common.constants;

import org.springframework.beans.factory.annotation.Value;

/**
 * @author: mengzheng.mhc
 * @date: 2024/6/19 10:06
 */
public class Constants {

    /**
     * 1号空间是默认空间
     */
    public static final Long DEFAULT_PROJECT_ID = 1L;

    public static final String HEADER_PROJECT_ID = "X-Project-Id";

    public static final String HEADER_ACCESS_TOKEN = "accessToken";

    public static final String PARAM_PROJECT_ID = "projectId";

    public static final String HEADER_USER_ID = "X-User-Id";

    public static final String PARAM_USER_ID = "userId";

    public static final String SYS_QUERY = "系统操作";

    // ================================== 文件采集日志 =====================================
    public static final String TEXT_EXPORT_LOG = "text_export_log";

    public static class RedisKey {
        // ================================== 通用 =====================================

        public static final String COMMON_FILE_CHUNK_UPLOAD_EXP = "file_chunk_upload:%s:%s:%s";

        public static final String PROJECT_STORAGE_SIZE_EXP = "project_storage_size:%s";

        public static final String PROJECT_TABLE_STORAGE_SIZE_EXP = "project_table_storage_size:%s";

        // ================================== 通用 =====================================

        // ================================== 对象存储 =====================================

        public static final String FILE_CHUNK_UPLOAD_EXP = "unstructured_file_chunk_upload:%s:%s:%s";

        public static final String BUCKET_VISIT_COUNT_EXP = "unstructured_bucket_visit_count:%s:%s";

        public static final String BUCKET_UPLOAD_COUNT_EXP = "unstructured_bucket_upload_count:%s:%s";

        public static final String BUCKET_FLOW_EXP = "unstructured_bucket_flow:%s:%s";

        public static final String FILE_CHUNK_COMPOSE_STATUS_EXP =
                "unstructured_file_chunk_compose_status:%s";

        // ================================== 对象存储 =====================================

        // ================================== 权限 =====================================

        public static final String PROJECT_AUTH_EXP = "project_auth:%s:%s:%s";

        public static final String SYSTEM_AUTH_EXP = "system_auth:%s:%s";

        public static final String TENANT_ADMIN_EXP = "tenant_admin:%s";

        public static final String DATASOURCE_LAST_UPDATE = "dataSourceUpdateKey";

        // ================================== 权限 =====================================

        // ================================== 离线开发 =====================================
        public static final String DATADEV_SQL_KEYWORD = "datadev_keyword_project_id_%s";

        public static final String SECRET_LEVEL = "secret_level_%s";
    }

    public static class LogFileExp {

        public static final String COL_SEPARATOR = "\004\001\003\005\002";

        public static final String RS_TMP_FILE_SUFFIX = ".rs.tmp";

        public static final String RS_FILE_SUFFIX = ".rs";

        public static final String OFFLINE_DEV_JOB_LOG_EXP = "offline_dev_job";
        public static final String IMPORT_LOG = "import";
        public static final String OFFLINE_SYNC_LOG = "offline_sync_job";
        public static final String OFFLINE_SYNC_API_LOG = "offline_sync_api_job";
        public static final String OFFLINE_DEV_JOB_RS_EXP = "offline_dev_job_rs";
        public static final String SQL_FILE_SUFFIX = ".sql";
    }

    public static final Integer ISFD_TOKEN_CACHE_EXPIRE_TIME  = 30;
    public static final String WEB_API = "webApi";
    public static final String OPEN_API = "openapi";
}
